using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class HPscale : MaskableGraphic
{
    public GameObject pawn;
    private Pawn pawnInstance;
    private float HPmax;
    // Start is called before the first frame update
    void Start()
    {
        //pawnInstance=pawn.GetComponent<Pawn>();
        //Debug.Log(pawnInstance);
        //HPmax = pawnInstance.Card.HealPoint;
    }

    protected override void OnPopulateMesh(VertexHelper vh)
    {
        if (HPmax == 0)
        {
            return;
        }
        vh.Clear();
        Test(vh);
    }

    private void Test(VertexHelper vh)
    {
        //Rect rect = GetPixelAdjustedRect();
        //float x=rect.xMin;
        //float y=rect.yMin;
        //vh.AddVert(new Vector3(x, y, 0), color, Vector2.zero);
        //vh.AddVert(new Vector3(x, y + rect.height,0), color, Vector2.zero);
        //vh.AddVert(new Vector3(x + rect.width, y + rect.height, 0), color, Vector2.zero);
        //vh.AddVert(new Vector3(x + rect.width, y, 0), color, Vector2.zero);

        //vh.AddTriangle(0, 1, 2);
        //vh.AddTriangle(0, 2, 3);
    }
    // Update is called once per frame
    void Update()
    {
        
    }
}
